/**
 * Created by YanXu on 2016/9/29.
 */

'use strict';

ImporInfor()

//获取订单编号
var orderNo = getQueryString("orderNo");

var urlgetmyPurchaseOrderDetail="/order/get/myPurchaseOrderDetail";

//填充数据
fillData(orderNo,urlgetmyPurchaseOrderDetail);

//填充数据函数
function fillData(orderNo,url){
    if(orderNo==null|| orderNo.toString().length<1){
            return;
    }
    var parm = "orderNo="+orderNo +"&" + Infornation;

    $.ajax({
        url:host+url,
        type : "post",
        data:parm,
        success:function(res){
            console.log(res)
            if(res.success == true){
                if(res.data.length<1){
                    return;
                }
                $("#content .modular .order-no").html(res.data[0].orderNo);
                $("#content .purchasing-info .content .meat-category").html(res.data[0].meatCategory.join(","));
                $("#content .purchasing-info .content .purchase-desc").html(res.data[0].purchaseDesc);
                $("#content .purchasing-info .content .amount").html(Math.round(res.data[0].amount/1000*100)/100);
				
				$("#content .purchasing-info .content .unit").html('吨');
				$("#content .purchasing-info .content .price").html((res.data[0]['price'] == '' ?strNew : res.data[0]['price']));
                $("#content .purchasing-info .content .delivery-area").html(res.data[0].deliveryArea);
                $("#content .purchasing-info .content .deal-user").html(res.data[0].dealUser);
               
			//供应描述
                $("#content .modular  .provide-info").html(res.data[0].statement );
			//供应商姓名
   				$("#content .modular  .provide-user").html(res.data[0].provideUser );
   			//供应商电话
				$("#content .modular  .provide-phone").html(res.data[0].providePhone );	
                //订单状态
               var orderstatus =  res.data[0].status;
                if(orderstatus==2){
                    $("#content .modular  .order-status").html("交易中");
                }else if(orderstatus==3){
                    $("#content .modular  .order-status").html("交易成功");
                }else if(orderstatus==4){
                    $("#content .modular  .order-status").html("交易失败");
                }


                $("#content .modular  .update-date").html(res.data[0].updateDate);
            }else{

            }
        },
    });

}






